<template>
    <div>
        <h2>公告首页</h2>
        <h3>eventBus</h3>
        <Aaa></Aaa>
        <Bbb></Bbb>
    </div>
</template>
<script>

import Event from '../utils/eventBus'
import Aaa from '../components/Aaa.vue'
import Bbb from '../components/Bbb.vue'
export default{
    components:{
        Aaa,
        Bbb
    },
    data(){
        return {
            msg:'我是公告首页的数据'
        }
    },
    methods:{
        go(){
            //Event.$emit('aaa',this.msg);
        }
    },
    created(){
        Event.$emit('aaa',this.msg);

        
    },
    mounted(){
        Event.$on('bbb',(v)=>{
            console.log(v);
        })
    },
    beforeDestroy(){
        Event.$off();
    }
}
</script>